package com.lfd.jvm.pojo;

import java.util.concurrent.*;

/**
 * @项目名： spring-emq
 * @包名： com.lfd.jvm.pojo
 * @文件名: Parent
 * @创建者: liufudong@szyh-smart.com
 * @创建时间: 2024/10/14 21:14
 * @描述：
 */

public class Parent {
    // 父类静态变量
    static String staticField = "父类静态变量";

    // 父类静态代码块
    static {
        System.out.println("父类静态代码块");
    }

    // 父类构造代码块
    {
        System.out.println("父类构造代码块");
    }

    // 父类构造函数
    public Parent() {
        System.out.println("父类构造函数");
    }

    public static void main(String[] args) throws ExecutionException, InterruptedException {
        ThreadPoolExecutor threadPoolExecutor =
                new ThreadPoolExecutor(1, 1, 60, TimeUnit.SECONDS,
                        new LinkedBlockingQueue<Runnable>());
        Future<?> submit = threadPoolExecutor.submit(new Runnable() {
            @Override
            public void run() {
                System.out.println("=========1");
                int i = 1 / 0;
                System.out.println("=========2");
            }
        });
        Object object = submit.get();
        System.out.println("=========object====="+object);
    }
}
